import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class MTFoodItem extends StatelessWidget {
  const MTFoodItem({Key? key, required this.foodItem}) : super(key: key);

  final Map<String, dynamic> foodItem;

  @override
  Widget build(BuildContext context) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          margin: const EdgeInsets.all(10),
          child: ClipRRect(
            borderRadius: BorderRadius.circular(10),
            child: Image.network(
              foodItem["picture"],
              width: 100,
              height: 100,
              fit: BoxFit.cover,
            ),
          ),
        ),
        Padding(
          padding: const EdgeInsets.only(top: 10, bottom: 10),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(
                foodItem["name"],
                style:
                    const TextStyle(fontWeight: FontWeight.w600, fontSize: 20),
              ),
              Text(
                  '月销量${foodItem["month_saled"]} ${foodItem["like_ratio_desc"]}',
                  style: const TextStyle(
                      fontWeight: FontWeight.w500, fontSize: 14)),
              Text(foodItem["price"].toString(),
                  style: const TextStyle(
                      fontWeight: FontWeight.w600,
                      fontSize: 14,
                      color: Colors.amber))
              // Text(),
              // Text(),
              // Text(),
            ],
          ),
        )
      ],
    );
  }
}
